package PinDuoDuo;

import org.junit.After;
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.util.Scanner;

public class Solution1 {
    static int n;
    static char ch[];
    static char martix[][];
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);

        ch = scanner.nextLine().toCharArray();
        n=ch.length/4+1;
        martix =new char[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                martix[i][j]=' ';
            }
        }
        int count=0;
        for (int i = 0; i <n ; i++) {
            martix[0][i]=ch[count];
            count++;
        }
        for (int i = 1; i < n-1; i++) {
            martix[i][n-1]=ch[count];
            count++;
        }
        for (int i = n-1; i >=0; i--) {
            martix[n-1][i]=ch[count];
            count++;
        }
        for (int i = n-2; i >=1; i--) {
            martix[i][0]=ch[count];
            count++;
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                System.out.print(martix[i][j]);
            }
            System.out.println();
        }
    }


    @Test
    public void test1(){
        String data = "123456789012";
        System.setIn(new ByteArrayInputStream(data.getBytes()));
        String[] args={};
        main(args);
    }
    @After
    public void after(){

    }

}
